<template>
  <!-- 关于我们 -->
  <div class="invitationLogBox">
    <x-header :left-options="{showBack: true,backText:'我的邀请记录'}" class="headerBox"></x-header>
    <!-- 内容 -->
    <div v-if="newRecordList.length>0">
      <div class="recordData">
        <img src="../assets/images/card122x.png" class="contentBorder" />
        <div class="dataDetails">
          <div>
            <div class="data">
              <span>10</span>人
            </div>
            <div class="fs_26">共邀请好友</div>
          </div>
          <div>
            <div class="data">
              <span>1000.0</span>元
            </div>
            <div class="fs_26">累计获得奖励</div>
          </div>
        </div>
      </div>
      <div class="invitationRecord">
        <div class="recordTitle">全部邀请记录</div>
        <div class="flex_sb recordList" v-for="(item,index) in newRecordList" :key="index">
          <div class="flex_center">
            <div class="listNum">{{item.listNum}}</div>
            <img :src="item.head" class="invitationHead" />
            <div>
              <div class="fs_32">{{item.tel}}</div>
              <div class="fs_24 color_graya">{{item.time}}</div>
            </div>
          </div>
          <div class="fs_24 color_graya">
            获得奖励
            <span class="reward">{{item.reward}}元</span>
          </div>
        </div>
      </div>
      <div class="continue">继续邀请</div>
    </div>

    <!-- 记录为空 显示 -->
    <div class="empty" v-else>
      <img src="../assets/images/nullmaterial05.png" class="invitationTips" />
      <div class="fs_24 color_graya mt_40">邀请记录为空，快去邀请小伙伴一起学习吧</div>
      <div class="inviteBtn">立即邀请</div>
    </div>
  </div>
</template>

<script>
import { XHeader, XDialog, Popup } from "vux";
export default {
  components: {
    XHeader, XDialog, Popup
  },
  data() {
    return {
      // 邀请记录
      recordList: [
        {
          listNum: '1',
          head: require('../assets/images/headportrait452.png'),
          tel: '136****9875',
          time: '2019.02.03',
          reward: '50'
        },
        {
          listNum: '2',
          head: require('../assets/images/headportrait452.png'),
          tel: '136****9875',
          time: '2019.02.03',
          reward: '50'
        },
        {
          listNum: '3',
          head: require('../assets/images/headportrait452.png'),
          tel: '136****9875',
          time: '2019.02.03',
          reward: '50'
        }
      ],
      newRecordList: []
    }
  },
  mounted() {
    setTimeout(() => {
      this.newRecordList = this.recordList
    }, 2000);
  },
  methods: {
  },
}
</script>

<style lang="less" scoped>
.invitationLogBox {
  // 头部导航
  /deep/.headerBox {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    .vux-header-left {
      left: 24px;
      .vux-header-back {
        color: #000;
      }
      .left-arrow:before {
        border-color: #000;
      }
    }
  }
  /* 内容样式 */
  .recordData {
    // margin-top: 5px;
    background: #fff;
    padding: 20px 0 20px;
    position: relative;
    border-bottom: 20px solid #f8f9fa;
    img {
      width: 706px;
      height: 273px;
      margin: 0 auto;
      display: block;
    }

    .dataDetails {
      position: absolute;
      top: 110px;
      left: 30px;
      right: 30px;
      display: flex;
      color: #fff;
    }

    .dataDetails > div {
      flex: 1;
      text-align: center;
    }

    .dataDetails > div:last-child {
      border-left: 2px solid rgba(255, 255, 255, 0.5);
    }

    .data {
      font-size: 28px;
    }

    .data span {
      font-size: 38px;
    }
  }

  .invitationRecord {
    background: #fff;
    margin-bottom: 100px;
    .recordTitle {
      text-align: center;
      padding: 20px 0;
      font-size: 36px;
    }

    .recordList {
      padding: 20px;
      margin: 0 20px;
      border-bottom: 1px solid #eff0f0;
    }

    .listNum {
      color: #5f5f5f;
      font-size: 30px;
    }

    .invitationHead {
      width: 90px;
      height: 89px;
      margin: 0 30px;
    }

    .reward {
      color: #f78d38;
      font-size: 34px;
    }
  }
  .continue {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    background: #6592f5;
    line-height: 3;
    color: #fff;
    font-size: 30px;
  }
  /* 记录为空 */
  .empty {
    position: absolute;
    top: 260px;
    left: 0;
    right: 0;
    text-align: center;
    .invitationTips {
      width: 302px;
      height: 299px;
    }
    .inviteBtn {
      background: #679aff;
      display: inline-block;
      color: #fff;
      font-size: 30px;
      padding: 20px 180px;
      border-radius: 40px;
      margin-top: 30px;
    }
  }
}
</style>